//
//  YMPDFObject.h
//  TestDemo
//
//  Created by fantasy on 16/6/26.
//  Copyright © 2016年 goappbox. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKit.h>

@interface YMPDFObject : NSObject
- (instancetype) init NS_UNAVAILABLE;
- (instancetype) initWithDictionary:(CGPDFDictionaryRef)dictionary NS_DESIGNATED_INITIALIZER;
- (instancetype) initWithWithObject:(CGPDFObjectRef)object key:(NSString *)key NS_DESIGNATED_INITIALIZER;

@property (nonatomic, strong, readonly) NSString *key;
@property (nonatomic, assign, readonly) CGPDFObjectType type;

@property (nonatomic, strong, readonly) NSString *string;
@property (nonatomic, strong, readonly) NSString *name;
@property (nonatomic, strong, readonly) UIImage *image;
@property (nonatomic, assign, readonly) BOOL boolValue;
@property (nonatomic, assign, readonly) BOOL realValue;
@property (nonatomic, assign, readonly) BOOL integerValue;
@property (nonatomic, assign, readonly) BOOL isNull;

- (void)appliedToPDFObject:(CGPDFObjectRef)object forKey:(NSString *)key;

- (void)appliedAllObject;

- (NSArray *)keyNames;
- (NSDictionary *)allObjectDictionary;

- (NSArray *)children;
-(void)addToChildren:(id)obj;

- (void)parserNull:(CGPDFObjectRef)object;
- (void)parserArray:(CGPDFObjectRef)object;
- (void)parserReal:(CGPDFObjectRef)object;
- (void)parserBool:(CGPDFObjectRef)object;
- (void)parserInteger:(CGPDFObjectRef)object;
- (void)parserName:(CGPDFObjectRef)object;
- (void)parserString:(CGPDFObjectRef)object;
- (void)parserImage:(NSData *)data format:(CGPDFDataFormat)format;

- (void)setObject:(id)object forKeyedSubscript:(id < NSCopying >)aKey;

- (id)objectForKeyedSubscript:(id)key;

- (void)setObject:(id)anObject atIndexedSubscript:(NSUInteger)index;
- (id)objectAtIndexedSubscript:(NSUInteger)idx;

- (NSDate *)dateFromValue:(CGPDFStringRef)str;

- (NSString *)stringFromValue:(CGPDFStringRef)str;

- (NSString *)stringFromObject:(CGPDFObjectRef)object;

@end
